@isTest
private class InstrumentProjectBonusHandlerTest {
	/*

		InstrumentProjectBonusHandler
		AchievementRateHandler
	*/
    static testMethod void testMethod1() {

    	  Id ldcProfile1 = [Select Id,Name From Profile Where Name like '%销售员%' limit 1 ].Id;
        User u1 = new User( Alias = 'samLdc1', 
                         Email = 'ldc@test.com.maike',
                         Emailencodingkey = 'UTF-8', 
                         Lastname = '用户1', 
                         Languagelocalekey = 'en_US',
                         Localesidkey = 'en_US', 
                         Profileid = ldcProfile1, 
                         Country = 'United States',
                         companyName = 'Y-MKSY',
                         IsActive = true,
                         SubCompany__c='四川省迈克实业有限公司',
                         UserDepartment__c='客户服务中心(工程部)',
                         Timezonesidkey = 'America/Los_Angeles', 
                         EmployeeNumber = '123456',
                         Username = 'Matldc1@test.com.maike');
        insert u1;
		//合同        
        Contract__c con = new Contract__c();
        con.Status__c = '已生效';
        con.TotalTaskAmount__c = 10;
        con.CooperationYear__c =5;
        insert con;

        //奖金备案申请
        InstrumentProjectBonus__c inp = new InstrumentProjectBonus__c();
        inp.OwnerId = u1.Id;
     
        insert inp; 

        //奖金备案申请明细
        InstrumentProjectBonusDetails__c ipd = new InstrumentProjectBonusDetails__c();
        ipd.InstrumentBonus__c = inp.Id;
        ipd.Contract__c = con.Id;
        insert ipd;


        inp.Status__c = '审批中';
        update inp; 

    }
}